﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace LS.FrmUI.Dal
{
   public  class AreaDal
    {
       public List<string> GetAllArea()
       {
           string filePath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "地区排序设置.txt");
           List<string> relList = new List<string>();

           if (!File.Exists(filePath))
           {
               File.WriteAllText(filePath, "",Encoding.UTF8);
           }
           else
           {
               List<string> areaList = File.ReadLines(filePath,Encoding.UTF8).ToList();
               string temp = string.Empty;
               foreach (var item in areaList)
               {
                   temp = item.Trim();
                   if (!string.IsNullOrEmpty(temp))
                   {
                       relList.Add(temp);
                   }
               }
           }

           return relList.Distinct().ToList();
       }
    }
}
